#ifndef _TEST_CAM_H
#define _TEST_CAM_H

#include <asm/types.h>
#include <linux/videodev2.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <linux/fb.h>
/** for open() */
#include <fcntl.h>
/** for mmap() */
#include <unistd.h>
#include <sys/mman.h>

#include <assert.h>
#include <errno.h>
#include <string.h>
#include "common.h"

#define NB_BUFFER 10

#define CLIP(value) (uint8_t)(((value)>0xFF)?0xff:(((value)<0)?0:(value)))

#define CAM_DEV "/dev/video1"

typedef struct {
        PIXEL *addr;
        int width, height;
        unsigned int BPP;
}TRect;

int initCam();
void preview(int fd);
void capture(int fd);
void rmRect(TRect rect);

#endif
